package com.zhongen.oa.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseMapper;
import com.zhongen.admin.api.entity.SysUser;
import com.zhongen.oa.entity.ProjectTeamEntity;
import com.zhongen.oa.entity.ProjectTeamUserRelationshipEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProjectTeamMapper extends MPJBaseMapper<ProjectTeamEntity> {

	IPage<ProjectTeamEntity> queryTeamInfoList(Page page,
			@Param("ProjectTeamEntity") ProjectTeamEntity projectTeamEntity);

	void addTeamMembers(ProjectTeamUserRelationshipEntity relationshipEntity);

	/**
	 * 批量查询团队成员
	 * @param teamId
	 * @param userList
	 */
	void insertTeamMembers(@Param("teamId") Long teamId, @Param("userList") List<Long> userList);

	/**
	 * 根据团队id查询成员
	 * @param id
	 * @return
	 */
	List<ProjectTeamUserRelationshipEntity> selectTeamUser(@Param("teamId") Long id);

	/**
	 * 删除团队成员关联关系
	 * @param id
	 * @param teamUserList
	 */
	void deleteTeamUsers(@Param("teamId") Long id, @Param("teamUserList") List<Long> teamUserList);

}
